﻿<controls:ChildWindow x:Class="Thor.Silverlight.Views.NewAdministrator"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                                 xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
           xmlns:domainServices="clr-namespace:Thor.WebRole.Services"
           xmlns:activity="clr-namespace:System.Windows.Controls;assembly=ActivityControl"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input"
           xmlns:datagroup="clr-namespace:System.Windows.Data;assembly=System.Windows.Controls.Ria"
           Width="500" Height="300" 
           Title="new administrator">
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <dataFormToolkit:DataForm x:Name="newAdministratorForm" Grid.Row="0"
                                  CommandButtonsVisibility="None"
                                  AutoGenerateFields="False">
            <dataFormToolkit:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding ApplicationStrings.AddNewAdministrator, Source={StaticResource ResourceWrapper}}" Style="{StaticResource groupHeaderStyle}" />
                        <Border Style="{StaticResource groupBorderStyle}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="120" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="{Binding ApplicationStrings.EmailAddressLabelText, Source={StaticResource ResourceWrapper}}"
                                                           Grid.Row="0" Grid.Column="0" Style="{StaticResource requiredLabelStyle}" />
                                <dataFormToolkit:DataField Grid.Row="0" Grid.Column="1" LabelVisibility="Collapsed">
                                    <TextBox Text="{Binding EmailAddress, Mode=TwoWay}" Width="250" 
                                             Style="{StaticResource textFieldStyle}" HorizontalAlignment="Left" />
                                </dataFormToolkit:DataField>

                                <TextBlock Text="{Binding ApplicationStrings.UserNameLabel, Source={StaticResource ResourceWrapper}}"
                                                           Grid.Row="1" Grid.Column="0" Style="{StaticResource requiredLabelStyle}" />
                                <dataFormToolkit:DataField Grid.Row="1" Grid.Column="1" LabelVisibility="Collapsed">
                                    <TextBox Text="{Binding UserName, Mode=TwoWay}" Width="250" 
                                             Style="{StaticResource textFieldStyle}" HorizontalAlignment="Left" />
                                </dataFormToolkit:DataField>
                                
                                <TextBlock Text="{Binding ApplicationStrings.FirstNameLabelText, Source={StaticResource ResourceWrapper}}"
                                                           Grid.Row="2" Grid.Column="0" Style="{StaticResource requiredLabelStyle}" />
                                <dataFormToolkit:DataField Grid.Row="2" Grid.Column="1" LabelVisibility="Collapsed">
                                    <TextBox Text="{Binding FirstName, Mode=TwoWay}" Width="250" 
                                             Style="{StaticResource textFieldStyle}" HorizontalAlignment="Left" />
                                </dataFormToolkit:DataField>

                                <TextBlock Text="{Binding ApplicationStrings.LastNameLabelText, Source={StaticResource ResourceWrapper}}"
                                                           Grid.Row="3" Grid.Column="0" Style="{StaticResource requiredLabelStyle}" />
                                <dataFormToolkit:DataField Grid.Row="3" Grid.Column="1" LabelVisibility="Collapsed">
                                    <TextBox Text="{Binding LastName, Mode=TwoWay}" Width="250" 
                                             Style="{StaticResource textFieldStyle}" HorizontalAlignment="Left" />
                                </dataFormToolkit:DataField>
                            </Grid>
                        </Border>
                    </StackPanel>
                </DataTemplate>
            </dataFormToolkit:DataForm.EditTemplate>
            
        </dataFormToolkit:DataForm>
        <Button x:Name="CancelButton" Content="{Binding ApplicationStrings.CancelButtonText, Source={StaticResource ResourceWrapper}}" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="{Binding ApplicationStrings.OKButtonText, Source={StaticResource ResourceWrapper}}" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>